<layout name="layout" />

<script src="{$uri}Public/Scripts/PSI/DMO/DMOMainForm.js?dt={$dtFlag}" type="text/javascript"></script>
<!-- GoodsPrice会mix到DMOEditForm，所以需要放在其前面引用 -->
<script src="{$uri}Public/Scripts/PSI/Mix/GoodsPrice.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/DMO/DMOEditForm.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/Factory/FactoryField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Factory/FactoryEditForm.js?dt={$dtFlag}" type="text/javascript"></script>

<!-- OrgWithDataOrgField在DMOEditForm中使用 -->
<script src="{$uri}Public/Scripts/PSI/User/OrgWithDataOrgField.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Scripts/PSI/UX/CellEditing.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/User/UserField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsEditForm.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsCategoryField.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Goods/GoodsBrandField.js?dt={$dtFlag}" type="text/javascript"></script>

<!-- 生成入库单 -->
<script src="{$uri}Public/Scripts/PSI/DMW/DMWEditForm.js?dt={$dtFlag}" type="text/javascript"></script>
<script src="{$uri}Public/Scripts/PSI/Warehouse/WarehouseField.js?dt={$dtFlag}" type="text/javascript"></script>

<script src="{$uri}Public/Lodop/LodopFuncs.js?dt={$dtFlag}" type="text/javascript"></script>

<script>
  Ext.onReady(function () {
    var app = Ext.create("PSI.App", {
      userName: "{$loginUserName}",
      productionName: "{$productionName}"
    });

    var permission = {
      add: "{$pAdd}",
      edit: "{$pEdit}",
      del: "{$pDelete}",
      closeBill: "{$pCloseBill}",
      genPDF: "{$pGenPDF}",
      commit: "{$pCommit}",
      genDMWBill: "{$pGenDMWBill}",
      showAddGoodsButton: "{$showAddGoodsButton}",
      showAddFactoryButton: "{$showAddFactoryButton}",
      print: "{$pPrint}"
    };

    app.add(Ext.create("PSI.DMO.DMOMainForm", {
      permission: permission
    }));
    app.setAppHeader({
      title: "{$title}"
    });
  });
</script>
